<template>
  <div id="main" />
</template>

<script>
import * as echarts from 'echarts'

export default {
  name: '',
  data() {
    return {

    }
  },
  mounted() {
    this.inneEcharts()
  },
  // 定义方法
  methods: {
    inneEcharts() {
      var chartDom = document.getElementById('main')
      var myChart = echarts.init(chartDom)
      var option

      option = {
        title: {
        },
        legend: {
          data: ['Allocated Budget', 'Actual Spending']
        },
        color: ['red', 'pink'],
        splitArea: {
          show: false
        },
        radar: {
          // shape: 'circle',
          indicator: [
            { name: 'Sales', max: 100 },
            { name: 'Administration', max: 100 },
            { name: 'Information Technology', max: 100 },
            { name: 'Customer Support', max: 100 },
            { name: 'Development', max: 100 },
            { name: 'Marketing', max: 100 }
          ]
        },
        series: [
          {
            name: 'Budget vs spending',
            type: 'radar',
            data: [
              {
                value: [100, 100, 100, 100, 100, 5],
                name: 'Allocated Budget'
              },
              {
                value: [30, 50, 40, 60, 10, 55],
                name: 'Actual Spending'
              }
            ]
          }
        ]
      }
      option && myChart.setOption(option)
    }
  }

}
</script>

<style scoped lang='scss'>
  #main {
    width: 300px;
    height: 300px;
  }
</style>
